1. Field of the Invention
The present invention relates to an imaging apparatus, a method for controlling the imaging apparatus, and a storage medium. In particular, the present invention relates to underwater flash photography.
2. Description of the Related Art
A digital camera, as an example of an imaging apparatus, digitizes a signal output from an image sensor via A/D conversion and divides the signal into a plurality of blocks. The block signals include color signals including red (R), green (G), and blue (B), and, for example, color evaluation values of the blocks are calculated by Expression (1):Cx[i]=(R[i]−B[i])/Y[i]×1024,andCy[i]=(R[i]+B[i]−2G[i])/Y[i]×1024  (1)(where Y[i]=R[i]+2G[i]+B[i]).
The digital camera determines that a block is white when a color evaluation value (Cx[i], Cy[i]) is included in a predetermined white detection range. Then, the digital camera calculates integrated values sumR, sumG, and sumB of color pixels included in the white detection range and calculates white balance coefficients according to Expression (2) below:WBCo_R=sumY×1024/sumR WBCo_G=sumY×1024/sumG, andWbCo_B=sumY×1024/sumB,  (2)where sumY=(sumR+2×sumG+sumB)/4
However, when photography is performed underwater, a long wavelength band of light easily attenuates due to the influence of spectral transmittance of water. Therefore, the ratio of R light decreases compared to G light and B light, and thus a bluish image may be obtained.
Further, as a distance between the surface of water and a camera or an object (a depth from the surface of water) is longer underwater, the R component of natural light reaching from the outside of water reduces. Therefore, it is difficult to maintain the following property of white balance.
An electronic camera discussed in Japanese Patent No. 4144390 sets an adjustment coefficient used at the time of adjusting the white balance before photography and controls other white balance adjustment coefficients based on depth information detected by an indicator for depth that detects a depth where a camera is located.
In underwater photography, when the water depth is deep, a color is rarely produced due to the above-described reason. When the water depth is approximately greater than 10 meters, the color is not produced and an image close to gray is formed even if the white balance is adjusted. A flash unit emits light during underwater photography to avoid such an issue, and, accordingly, a desirable color-reproduced image can be obtained.
On the other hand, an electronic still camera discussed in Japanese Patent No. 3528202 estimates a tint variation amount of the flash caused by an optical path length and, according to the distance to an object, varies a white balance control value when adjusting the white balance underwater.
When flash photography is performed underwater and the white balance is appropriately controlled for a main object, the main object turns to an image with an appropriate white balance. However, assume that, for example, when an object, such as a coral or a rock, is present particularly at a macro distance equal to or less than 50 cm in front of the main object, or, when flash is not emitted at a suitable angle because of an external flash or the like, a region having illuminance higher than the main object and irradiated with flash is present. In this case, in an object in front of the main object or the region having high illuminance, red is enhanced than that in the main object. Thus, there arises an issue that an unnatural image is obtained.
Since the color of the water is blue underwater, the sense of discomfort is small when the color of the image is changed to blue. However, when red is produced, an unnatural image for which the sense of discomfort is large may be formed. In order to resolve such an issue, Japanese Patent No. 4144390 discusses a method of controlling white balance at the time of non-flash emission. According to this method, the issue with white balance control at the time of flash emission cannot be resolved. Further, the goal of Japanese Patent No. 3528202 is to control the white balance according to a distance to the main object and match the tint of the main object. Likewise, since an appropriate process is not performed on the above-described defective image, a desirable image may not be obtained.